package base.io;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class TestFileOutputStream {
    public static void main(String[] args) {
        int b =0;
        FileInputStream in = null;
        FileOutputStream out = null;
        try {
            in = new FileInputStream("D:\\IdeaProjects\\algorithm-test\\src\\javabase\\container\\TestIterator.java");
            out = new FileOutputStream("D:\\Name.java");
            while ((b=in.read())!=-1){
                out.write(b);
            }
            in.close();
            out.close();
        } catch (FileNotFoundException e) {
            System.out.print("系统找不到指定文件");
            System.exit(-1);
        }catch (IOException e1){
            System.out.print("文件复制错误");
            System.exit(-1);
        }
        System.out.println("文件已复制");
    }
}
